import { getToken } from '@/utils/auth'

const permission = {
  state: {
    //roles:[],
    shopMenuList: [],
    needUpdate:false
  },
  mutations: {
    // SET_ROLES: (state, routers) => {
    //   state.roles = routers;
    // },
    SET_ShopMenuList: (state, routers) => {
      state.shopMenuList = routers;
    },
    SET_NeedUpdate:(state,status)=>{
      state.needUpdate = status
    }
  },
  actions: {
    //判断权限是否存在
    // getRoles({ commit }, payload) {
    //   if (getToken()) {
    //     commit('SET_ROLES', payload)
    //   }
    // },
    getShopMenuList({ commit }, payload) {
      if (getToken()) {
        commit('SET_ShopMenuList', payload)
      }
    }

  }
}
export default permission
